home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / emacs-complete / fsf / emacs / info / sc-1 (.txt) < prev    next >
GNU Info File  |  1994-03-16  |  48KB  |  840 lines

  1. This is Info file ../info/sc, produced by Makeinfo-1.55 from the input
  2. file sc.texi.
  3.    This document describes the Supercite Version 3.1 package for citing
  4. and attributing the replies for various GNU Emacs mail and news reading
  5. subsystems.
  6.    Copyright (C) 1993 Barry A. Warsaw
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10. File: sc,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
  11.    This document describes the Supercite Version 3.1 package for citing
  12. and attributing the replies for various GNU Emacs mail and news reading
  13. subsystems.  The manual is divided into the following chapters.
  14. * Menu:
  15. * Introduction::
  16. * Citations::
  17. * Getting Connected::
  18. * Replying and Yanking::
  19. * Selecting an Attribution::
  20. * Configuring the Citation Engine::
  21. * Post-yank Formatting Commands::
  22. * Information Keys and the Info Alist::
  23. * Reference Headers::
  24. * Hints to MUA Authors::
  25. * Version 3 Changes::
  26. * Thanks and History::
  27. * The Supercite Mailing List::
  28. * Concept Index::
  29. * Command Index::
  30. * Key Index::
  31. * Variable Index::
  32. File: sc,  Node: Introduction,  Next: Usage Overview,  Prev: Top,  Up: Top
  33. Introduction
  34. ************
  35.    Supercite version 3.1 is a GNU Emacs package written entirely in
  36. Emacs Lisp. It interfaces to most of the commonly used Emacs mail user
  37. agents ("MUAs") and news user agents ("NUAs"), and provides
  38. sophisticated facilities for the citing and attributing of message
  39. replies.  Supercite has a very specific and limited role in the process
  40. of composing replies to both USENET network news and electronic mail.
  41.    The preferred way to spell Supercite is with a capital `S',
  42. lowercase `upercite'.  There are a few alternate spellings out there
  43. and I won't be terribly offended if you use them.  People often ask
  44. though...
  45. * Menu:
  46. * Usage Overview::
  47. * What Supercite Does Not Do::
  48. * What Supercite Does::
  49.    Supercite is only useful in conjunction with MUAs and NUAs such as
  50. VM, GNUS, RMAIL, etc. (hereafter referred to collectively as MUAs).
  51. Supercite is typically called by the MUA after a reply buffer has been
  52. setup.  Thereafter, Supercite's many commands and formatting styles are
  53. available in that reply buffer until the reply is sent.  Supercite is
  54. re-initialized in each new reply buffer.
  55.    Supercite is currently at major revision 3.1, and is known to work
  56. in the following environments:
  57. Emacsen:
  58.          GNU Emacs 18.57 through 18.59, all current FSF Emacs 19,
  59.      all current Lucid Emacs 19, and Epoch 4.
  60. MUAs:
  61.          VM 4.37 and beyond (including VM version 5), RMAIL, MH-E 3.7 and
  62.      beyond, PCMAIL.
  63. NUAs:
  64.          RNEWS, GNUS 3.12 and beyond, GNEWS.
  65.    For systems with version numbers, all known subsequent versions also
  66. work with Supercite.  For those systems without version numbers,
  67. Supercite probably works with any recently released version.  Note that
  68. only some of these systems will work with Supercite "out of the box."
  69. All others must overload interfacing routines to supply the necessary
  70. glue.  *Note Getting Connected:: for more details.
  71. File: sc,  Node: Usage Overview,  Next: What Supercite Does Not Do,  Prev: Introduction,  Up: Introduction
  72. Usage Overview
  73. ==============
  74.    Typical usage is as follows. You want to reply or followup to a
  75. message in your MUA. You will probably hit `r' (i.e., "reply") or `f'
  76. (i.e., "forward") to begin composing the reply.  In response, the MUA
  77. will create a reply buffer and initialize the outgoing mail headers
  78. appropriately.  The body of the reply will usually be empty at this
  79. point.  You now decide that you would like to include part of the
  80. original message in your reply. To do this, you "yank" the original
  81. message into the reply buffer, typically with a key stroke such as `C-c
  82. C-y'.  This sequence will invoke an MUA-specific function which fills
  83. the body of the reply with the original message and then "attributes"
  84. this text to its author.  This is called "citing" and its effect is to
  85. prefix every line from the original message with a special text tag.
  86. Most MUAs provide some default style of citing; by using Supercite you
  87. gain a wider flexibility in the look and style of citations.
  88. Supercite's only job is to cite the original message.
  89. File: sc,  Node: What Supercite Does Not Do,  Next: What Supercite Does,  Prev: Usage Overview,  Up: Introduction
  90. What Supercite Doesn't Do
  91. =========================
  92.    Because of this clear division of labor, there are useful features
  93. which are the sole responsibility of the MUA, even though it might seem
  94. that Supercite should provide them.  For example, many people would
  95. like to be able to yank (and cite) only a portion of the original
  96. message.  Since Supercite only modifies the text it finds in the reply
  97. buffer as set up by the MUA, it is the MUA's responsibility to do
  98. partial yanking.  *Note Reply Buffer Initialization::.
  99.    Another potentially useful thing would be for Supercite to set up the
  100. outgoing mail headers with information it gleans from the reply buffer.
  101. But by previously agreed upon convention, any text above the
  102. `mail-header-separator' which separates mail headers from message
  103. bodies cannot be modified by Supercite.  Supercite, in fact, doesn't
  104. know anything about the meaning of these headers, and never ventures
  105. outside the designated region. *Note Hints to MUA Authors:: for more
  106. details.
  107. File: sc,  Node: What Supercite Does,  Next: Citations,  Prev: What Supercite Does Not Do,  Up: Introduction
  108. What Supercite Does
  109. ===================
  110.    Supercite is invoked for the first time on a reply buffer via your
  111. MUA's reply or forward command.  This command will actually perform
  112. citations by calling a hook variable to which Supercite's top-level
  113. function `sc-cite-original' has been added.  When `sc-cite-original' is
  114. executed, the original message must be set up in a very specific way,
  115. but this is handled automatically by the MUA.  *Note Hints to MUA
  116. Authors::.
  117.    The first thing Supercite does, via `sc-cite-original', is to parse
  118. through the original message's mail headers.  It saves this data in an
  119. "information association list", or "info alist".  The information in
  120. this list is used in a number of places throughout Supercite.  *Note
  121. Information Keys and the Info Alist::.
  122.    After the mail header info is extracted, the headers are optionally
  123. removed ("nuked") from the reply.  Supercite then writes a "reference
  124. header" into the buffer.  This reference header is a string carrying
  125. details about the citation it is about to perform.
  126.    Next, Supercite visits each line in the reply, transforming the line
  127. according to a customizable "script".  Lines which were not previously
  128. cited in the original message are given a citation, while already cited
  129. lines remain untouched, or are coerced to your preferred style.
  130. Finally, Supercite installs a keymap into the reply buffer so that you
  131. have access to Supercite's post-yank formatting and reciting commands as
  132. you subsequently edit your reply.  You can tell that Supercite has been
  133. installed into the reply buffer because that buffer's modeline will
  134. display the minor mode string `SC'.
  135.    When the original message is cited by `sc-cite-original', it will
  136. (optionally) be filled by Supercite.  However, if you manually edit the
  137. cited text and want to re-fill it, you must use an add-on package such
  138. as `filladapt' or `gin-mode'.  These packages can recognize Supercited
  139. text and will fill them appropriately.  Emacs' built-in filling
  140. routines, e.g. `fill-paragraph', do not recognize cited text and will
  141. not re-fill them properly because it cannot guess the `fill-prefix'
  142. being used.  *Note Post-yank Formatting Commands:: for details.
  143.    As mentioned above, Supercite provides commands to recite or uncite
  144. regions of text in the reply buffer, and commands to perform other
  145. beautifications on the cited original text, maintaining consistent and
  146. informative citations throughout.  Supercite tries to be as configurable
  147. as possible to allow for a wide range of personalized citation styles,
  148. but it is also immediately useful with the default configuration, once
  149. it has been properly connected to your MUA.  *Note Getting Connected::
  150. for more details.
  151. File: sc,  Node: Citations,  Next: Citation Elements,  Prev: What Supercite Does,  Up: Top
  152. Citations
  153. *********
  154.    A "citation" is the acknowledgement of the original author of a mail
  155. message in the body of the reply.  There are two basic citation styles
  156. which Supercite supports.  The first, called "nested citations" is an
  157. anonymous form of citation; in other words, an indication is made that
  158. the cited line was written by someone *other* that the current message
  159. author (i.e., other than you, the person composing the reply), but no
  160. reference is made as to the identity of the original author.  This
  161. style should look familiar since its use on the net is widespread.
  162. Here's an example of what a message buffer would look like using nested
  163. citations after multiple replies:
  164.      >> John originally wrote this
  165.      >> and this as well
  166.      > Jane said that John didn't know
  167.      > what he was talking about
  168.      And that's what I think too.
  169. * Menu:
  170. * Citation Elements::
  171. * Recognizing Citations::
  172.    Note that multiple inclusions of the original messages result in a
  173. nesting of the ``>'' characters.  This can sometimes be quite confusing
  174. when many levels of citations are included since it may be difficult or
  175. impossible to figure out who actually participated in the thread, and
  176. multiple nesting of ``>'' characters can sometimes make the message
  177. very difficult for the eye to scan.
  178.    In "non-nested citations", each cited line begins with an
  179. informative string attributing that line to the original author. Only
  180. the first level of attribution will be shown; subsequent citations don't
  181. nest the citation strings. The above dialog might look like this when
  182. non-nested citations are used:
  183.      John> John originally wrote this
  184.      John> and this as well
  185.      Jane> Jane said that John didn't know
  186.      Jane> what he was talking about
  187.      And that's what I think too.
  188.    Notice here that my inclusion of Jane's inclusion of John's original
  189. message did not result in a line cited with `Jane>John>'.
  190.    Supercite supports both styles of citation, and the variable
  191. `sc-nested-citation-p' controls which style it will use when citing
  192. previously uncited text. When this variable is `nil' (the default),
  193. non-nested citations are used.  When non-`nil', nested citations are
  194. used.
  195. File: sc,  Node: Citation Elements,  Next: Recognizing Citations,  Prev: Citations,  Up: Citations
  196. Citation Elements
  197. =================
  198.    "Citation strings" are composed of one or more elements. Non-nested
  199. citations are composed of four elements, three of which are directly
  200. user definable.  The elements are concatenated together, in this order:
  201.   1. The "citation leader".  The citation leader is contained in the
  202.      variable `sc-citation-leader', and has the default value of a
  203.      string containing four spaces.
  204.   2. The "attribution string".  This element is supplied automatically
  205.      by Supercite, based on your preferences and the original message's
  206.      mail headers, though you may be asked to confirm Supercite's
  207.      choice.  *Note Selecting an Attribution:: for more details.
  208.   3. The "citation delimiter".  This string, contained in the variable
  209.      `sc-citation-delimiter' visually separates the citation from the
  210.      text of the line.  This variable has a default value of `">"' and
  211.      for best results, the string should consist of only a single
  212.      character.
  213.   4. The "citation separator".  The citation separator is contained in
  214.      the variable `sc-citation-separator', and has the default value of
  215.      a string containing a single space.
  216.    For example, suppose you were using the default values for the above
  217. variables, and Supercite provided the attribution string `Jane'.  In
  218. this case, the composed, non-nested citation string used might be
  219. something like `"    Jane> "'.  This citation string will be inserted
  220. in front of every line in the original message that is not already
  221. cited.
  222.    Nested citations, being simpler than non-nested citations, are
  223. composed of the same elements, sans the attribution string.  Supercite
  224. is smart enough to not put additional spaces between citation
  225. delimiters for multi-level nested citations.
  226. File: sc,  Node: Recognizing Citations,  Next: Getting Connected,  Prev: Citation Elements,  Up: Citations
  227. Recognizing Citations
  228. =====================
  229.    Supercite also recognizes citations in the original article, and can
  230. transform these already cited lines in a number of ways. This is how
  231. Supercite suppresses the multiple citing of non-nested citations.
  232. Recognition of cited lines is controlled by variables analogous to those
  233. that make up the citation string as mentioned previously.
  234.    The variable `sc-citation-leader-regexp' describes how citation
  235. leaders can look, by default it matches any number of spaces or tabs.
  236. Note that since the lisp function `looking-at' is used to do the
  237. matching, if you change this variable it need not start with a leading
  238. `"^"'.
  239.    Similarly, the variables `sc-citation-delimiter-regexp' and
  240. `sc-citation-separator-regexp' respectively describe how citation
  241. delimiters and separators can look.  They follow the same rule as
  242. `sc-citation-leader-regexp' above.
  243.    When Supercite composes a citation string, it provides the
  244. attribution automatically.  The analogous variable which handles
  245. recognition of the attribution part of citation strings is
  246. `sc-citation-root-regexp'.  This variable describes the attribution
  247. root for both nested and non-nested citations.  By default it can match
  248. zero-to-many alphanumeric characters (also ".", "-", and "_").  But in
  249. some situations, Supercite has to determine whether it is looking at a
  250. nested or non-nested citation.  Thus the variable
  251. `sc-citation-nonnested-root-regexp' is used to describe only non-nested
  252. citation roots.  It is important to remember that if you change
  253. `sc-citation-root-regexp' you should always also change
  254. `sc-citation-nonnested-root-regexp'.
  255.    Nemacs users: For best results, try setting
  256. `sc-citation-root-regexp' to:
  257.      "\\([-._a-zA-Z0-9]\\|\\cc\\|\\cC\\|\\ch\\|\\cH\\|\\ck\\|\\cK\\|\\ca\\|\\cg\\|\\cr\\|\\cu\\)*"
  258.    Mule users: For best results, try setting `sc-citation-root-regexp'
  259.      "\\([-._a-zA-Z0-9]\\|\\cj\\)*"
  260. File: sc,  Node: Information Keys and the Info Alist,  Next: Reference Headers,  Prev: Miscellaneous Commands,  Up: Top
  261. Information Keys and the Info Alist
  262. ***********************************
  263.    "Mail header information keys" are nuggets of information that
  264. Supercite extracts from the various mail headers of the original
  265. message, placed in the reply buffer by the MUA.  Information is kept in
  266. the "Info Alist" as key-value pairs, and can be retrieved for use in
  267. various places within Supercite, such as in header rewrite functions and
  268. attribution selection.  Other bits of data, composed and created by
  269. Supercite, are also kept as key-value pairs in this alist. In the case
  270. of mail fields, the key is the name of the field, omitting the trailing
  271. colon.  Info keys are always case insensitive (as are mail headers), and
  272. the value for a corresponding key can be retrieved from the alist with
  273. the `sc-mail-field' function.  Thus, if the following fields were
  274. present in the original article:
  275.      Date: 08 April 1991, 17:32:09 EST
  276.      Subject: Better get out your asbestos suit
  277. then, the following lisp constructs return:
  278.      (sc-mail-field "date")
  279.      ==> "08 April 1991, 17:32:09 EST"
  280.      
  281.      (sc-mail-field "subject")
  282.      ==> "Better get out your asbestos suit"
  283.    Since the argument to `sc-mail-field' can be any string, it is
  284. possible that the mail field will not be present on the info alist
  285. (possibly because the mail header was not present in the original
  286. message). In this case, `sc-mail-field' will return the value of the
  287. variable `sc-mumble'.
  288.    Supercite always places all mail fields found in the yanked original
  289. article into the info alist.  If possible, Supercite will also places
  290. the following keys into the info alist:
  291. `"sc-attribution"'
  292.      the selected attribution string.
  293. `"sc-citation"'
  294.      the non-nested citation string.
  295. `"sc-from-address"'
  296.      email address extracted from the `From:' field.
  297. `"sc-reply-address"'
  298.      email address extracted from the `Reply-To:' field.
  299. `"sc-sender-address"'
  300.      email address extracted from the `Sender:' field.
  301. `"sc-emailname"'
  302.      email terminus extracted from the `From:' field.
  303. `"sc-initials"'
  304.      the author's initials.
  305. `"sc-author"'
  306.      the author's full name.
  307. `"sc-firstname"'
  308.      the author's first name.
  309. `"sc-lastname"'
  310.      the author's last name.
  311. `"sc-middlename-1"'
  312.      the author's first middle name.
  313.    If the author's name has more than one middle name, they will appear
  314. as info keys with the appropriate index (e.g., `"sc-middlename-2"',
  315. ...).  *Note Selecting an Attribution::.
  316. File: sc,  Node: Reference Headers,  Next: The Built-in Header Rewrite Functions,  Prev: Information Keys and the Info Alist,  Up: Top
  317. Reference Headers
  318. *****************
  319.    Supercite will insert an informative "reference header" at the
  320. beginning of the cited body of text, which display more detail about the
  321. original article and provides the mapping between the attribution and
  322. the original author in non-nested citations.  Whereas the citation
  323. string usually only contains a portion of the original author's name,
  324. the reference header can contain such information as the author's full
  325. name, email address, the original article's subject, etc.  In fact any
  326. information contained in the info alist can be inserted into a reference
  327. header.
  328. * Menu:
  329. * The Built-in Header Rewrite Functions::
  330. * Electric References::
  331.    There are a number of built-in "header rewrite functions" supplied
  332. by Supercite, but you can write your own custom header rewrite functions
  333. (perhaps using the built-in ones as examples). The variable
  334. `sc-rewrite-header-list' contains the list of such header rewrite
  335. functions.  This list is consulted both when inserting the initial
  336. reference header, and when displaying "electric references".  *Note
  337. Electric References::.
  338.    When Supercite is initially run on a reply buffer (via
  339. `sc-cite-original'), it will automatically call one of these functions.
  340. The one it uses is defined in the variable `sc-preferred-header-style'.
  341. The value of this variable is an integer which is an index into the
  342. `sc-rewrite-header-list', beginning at zero.
  343. File: sc,  Node: The Built-in Header Rewrite Functions,  Next: Electric References,  Prev: Reference Headers,  Up: Reference Headers
  344. The Built-in Header Rewrite Functions
  345. =====================================
  346.    Below are examples of the various built-in header rewrite functions.
  347. Please note the following: first, the text which appears in the
  348. examples below as INFOKEY indicates that the corresponding value of the
  349. info key from the info alist will be inserted there.  (*Note
  350. Information Keys and the Info Alist::).  For example, in
  351. `sc-header-on-said' below, DATE and FROM correspond to the values of the
  352. `Date:' and `From:' mail headers respectively.
  353.    Also, the string `">>>>>"' below is really the value of the variable
  354. `sc-reference-tag-string'.  This variable is used in all built-in
  355. header rewrite functions, and you can customize its value to change the
  356. tag string globally.
  357.    Finally, the references headers actually written may omit certain
  358. parts of the header if the info key associated with INFOKEY is not
  359. present in the info alist.  In fact, for all built-in headers, if the
  360. `From:' field is not present in the mail headers, the entire reference
  361. header will be omitted (but this usually signals a serious problem
  362. either in your MUA or in Supercite's installation).
  363. `sc-no-header'
  364.      This function produces no header. It should be used instead of
  365.      `nil' to produce a blank header.  This header can possibly contain
  366.      a blank line after the `mail-header-separator' line.
  367. `sc-no-blank-line-or-header'
  368.      This function is similar to `sc-no-header' except that any blank
  369.      line after the `mail-header-separator' line will be removed.
  370. `sc-header-on-said'
  371.      `>>>>> On DATE, FROM said:'
  372. `sc-header-inarticle-writes'
  373.      `>>>>> In article MESSAGE-ID, FROM writes:'
  374. `sc-header-regarding-adds'
  375.      `>>>>> Regarding SUBJECT; FROM adds:'
  376. `sc-header-attributed-writes'
  377.      `>>>>> "SC-ATTRIBUTION" == SC-AUTHOR <SC-REPLY-ADDRESS> writes:'
  378. `sc-header-author-writes'
  379.      `>>>>> SC-AUTHOR writes:'
  380. `sc-header-verbose'
  381.      `>>>>> On DATE,'
  382.      `>>>>> SC-AUTHOR'
  383.      `>>>>> from the organization of ORGANIZATION'
  384.      `>>>>> who can be reached at: SC-REPLY-ADDRESS'
  385.      `>>>>> (whose comments are cited below with: "SC-CITE")'
  386.      `>>>>> had this to say in article MESSAGE-ID'
  387.      `>>>>> in newsgroups NEWSGROUPS'
  388.      `>>>>> concerning the subject of SUBJECT'
  389.      `>>>>> see REFERENCES for more details'
  390. File: sc,  Node: Electric References,  Next: Hints to MUA Authors,  Prev: The Built-in Header Rewrite Functions,  Up: Reference Headers
  391. Electric References
  392. ===================
  393.    By default, when Supercite cites the original message for the first
  394. time, it just goes ahead and inserts the reference header indexed by
  395. `sc-preferred-header-style'.  However, you may want to select different
  396. reference headers based on the type of reply or forwarding you are
  397. doing. You may also want to preview the reference header before
  398. deciding whether to insert it into the reply buffer or not. Supercite
  399. provides an optional "electric reference" mode which you can drop into
  400. to give you this functionality.
  401.    If the variable `sc-electric-references-p' is non-`nil', Supercite
  402. will bring up an electric reference mode buffer and place you into a
  403. recursive edit.  The electric reference buffer is read-only, so you
  404. cannot directly modify the reference text until you exit electric
  405. references and insert the text into the reply buffer.  But you can cycle
  406. through all the reference header rewrite functions in your
  407. `sc-rewrite-header-list'.
  408.    You can also set a new preferred header style, jump to any header, or
  409. jump to the preferred header. The header will be shown in the electric
  410. reference buffer and the header index and function name will appear in
  411. the echo area.
  412.    The following commands are available while in electric reference mode
  413. (shown here with their default key bindings):
  414. `sc-eref-next' (`n')
  415.      Displays the next reference header in the electric reference
  416.      buffer. If the variable `sc-electric-circular-p' is non-`nil',
  417.      invoking `sc-eref-next' while viewing the last reference header in
  418.      the list will wrap around to the first header.
  419. `sc-eref-prev' (`p')
  420.      Displays the previous reference header in the electric reference
  421.      buffer.  If the variable `sc-electric-circular-p' is non-`nil',
  422.      invoking `sc-eref-prev' will wrap around to the last header.
  423. `sc-eref-goto' (`g')
  424.      Goes to a specified reference header.  The index (into the
  425.      `sc-rewrite-header-list') can be specified as a numeric argument to
  426.      the command.  Otherwise, Supercite will query you for the index in
  427.      the minibuffer.
  428. `sc-eref-jump' (`j')
  429.      Display the preferred reference header, i.e., the one indexed by
  430.      the current value of `sc-preferred-header-style'.
  431. `sc-eref-setn' (`s')
  432.      Set the preferred reference header (i.e.,
  433.      `sc-preferred-header-style') to the currently displayed header.
  434. `sc-eref-exit' (LFD, RET, and ESC C-c)
  435.      Exit from electric reference mode and insert the current header
  436.      into the reply buffer.
  437. `sc-eref-abort' (`q', `x')
  438.      Exit from electric reference mode without inserting the current
  439.      header.
  440. Supercite will execute the hook `sc-electric-mode-hook' before entering
  441. electric reference mode.
  442. File: sc,  Node: Getting Connected,  Next: Emacs 19 MUAs,  Prev: Recognizing Citations,  Up: Top
  443. Getting Connected
  444. *****************
  445.    Hitting `C-c C-y' in your MUA's reply buffer yanks and cites the
  446. original message into the reply buffer.  In reality, the citation of the
  447. original message is performed via a call through a configurable hook
  448. variable.  The name of this variable has been agreed to in advance as
  449. part of the "citation interface specification".  By default this hook
  450. variable has a `nil' value, which the MUA recognizes to mean, "use your
  451. default citation function".  When you add Supercite's citation function
  452. to the hook, thereby giving the variable a non-`nil' value, it tells
  453. the MUA to run the hook via `run-hooks' instead of using the default
  454. citation.
  455. * Menu:
  456. * Emacs 19 MUAs::
  457. * Emacs 18 MUAs::
  458. * MH-E with any Emacsen::
  459. * VM with any Emacsen::
  460. * GNEWS with any Emacsen::
  461. * Overloading for Non-conforming MUAs::
  462.    Early in Supercite's development, the Supercite author, a few MUA
  463. authors, and some early Supercite users got together and agreed upon a
  464. standard interface between MUAs and citation packages (of which
  465. Supercite is currently the only known add-on :-).  With the recent
  466. release of the Free Software Foundation's GNU Emacs 19, the interface
  467. has undergone some modification and it is possible that not all MUAs
  468. support the new interface yet.  Some support only the old interface and
  469. some do not support the interface at all.  Still, it is possible for all
  470. known MUAs to use Supercite, and the following sections will outline the
  471. procedures you need to follow.
  472.    To learn exactly how to connect Supercite to the software systems you
  473. are using, read the appropriate following sections.  For details on the
  474. interface specifications, or if you are writing or maintaining an MUA,
  475. *note Hints to MUA Authors::..
  476.    The first thing that everyone should do, regardless of the MUA you
  477. are using is to set up Emacs so it will load Supercite at the
  478. appropriate time.  You can either dump Supercite into your Emacs binary
  479. (ask your local Emacs guru how to do this if you don't know), or you
  480. can set up an "autoload" for Supercite.  To do the latter, put the
  481. following in your `.emacs' file:
  482.      (autoload 'sc-cite-original     "supercite" "Supercite 3.1" t)
  483.      (autoload 'sc-submit-bug-report "supercite" "Supercite 3.1" t)
  484.    The function `sc-cite-original' is the top-level Supercite function
  485. designed to be run from the citation hook.  It expects `point' and
  486. `mark' to be set around the region to cite, and it expects the original
  487. article's mail headers to be present within this region.  Note that
  488. Supercite *never* touches any text outside this region.  Note further
  489. that for Emacs 19, the region need not be active for `sc-cite-original'
  490. to do its job.  *Note Hints to MUA Authors::.
  491.    The other step in the getting connected process is to make sure your
  492. MUA calls `sc-cite-original' at the right time.  As mentioned above,
  493. some MUAs handle this differently.  Read the sections that follow
  494. pertaining to the MUAs you are using.
  495.    One final note.  After Supercite is loaded into your Emacs session,
  496. it runs the hook `sc-load-hook'.  You can put any customizations into
  497. this hook since it is only run once.  This will not work, however, if
  498. your Emacs maintainer has put Supercite into your dumped Emacs' image.
  499. In that case, you can use the `sc-pre-hook' variable, but this will get
  500. executed every time `sc-cite-original' is called.  *Note Reply Buffer
  501. Initialization::.
  502. File: sc,  Node: Emacs 19 MUAs,  Next: Emacs 18 MUAs,  Prev: Getting Connected,  Up: Getting Connected
  503. GNUS, RMAIL, or RNEWS with any Emacs 19
  504. =======================================
  505.    These MUAs, distributed with both FSF and Lucid GNU Emacs 19, use
  506. Emacs' built-in yanking facility, which provides the citing hook
  507. variable `mail-citation-hook'.  By default, this hook's value is `nil',
  508. but by adding the following to your `.emacs' file, you can tell these
  509. MUAs to use Supercite to perform the citing of the original message:
  510.      (add-hook 'mail-citation-hook 'sc-cite-original)
  511.    GNUS users may also want to add the following bit of lisp as well.
  512. This prevents GNUS from inserting its default attribution header.
  513. Otherwise, both GNUS and Supercite will insert an attribution header:
  514.      (setq news-reply-header-hook nil)
  515.    Note that the `mail-citation-hook' interface described above was not
  516. supported in FSF Emacs 19 until version 19.16 and in Lucid Emacs 19
  517. until version 19.8.  If you are running an earlier version of one of
  518. these Emacsen, you will need to either upgrade to the latest version, or
  519. use the unsupported "overloading" feature provided with Supercite.
  520. *Note Overloading for Non-conforming MUAs::.
  521. File: sc,  Node: Emacs 18 MUAs,  Next: MH-E with any Emacsen,  Prev: Emacs 19 MUAs,  Up: Getting Connected
  522. GNUS, RMAIL, PCMAIL, RNEWS with Emacs 18 or Epoch 4
  523. ===================================================
  524.    These MUAs use Emacs' built-in yanking and citing routines,
  525. contained in the `sendmail.el' file.  `sendmail.el' for Emacs 18, and
  526. its derivative Epoch 4, do not know anything about the citation
  527. interface required by Supercite.  To connect Supercite to any of these
  528. MUAs under Emacs 18 or Epoch 4, you should first *note Overloading for
  529. Non-conforming MUAs::..  Then follow the directions for using these
  530. MUAs under Emacs 19.  *Note Emacs 19 MUAs::.
  531.    Note that those instructions will tell you to use the function
  532. `add-hook'. This function is new with Emacs 19 and you will not have it
  533. by default if you are running Emacs 18 or Epoch 4.  You can either
  534. substitute the appropriate call to `setq', or you can use the
  535. `add-hook' function that is provided in the `sc-unsupp.el' file of
  536. unsupported Supercite hacks and ideas.  Or you can upgrade to some
  537. Emacs 19 variant!  :-)
  538.    To use `setq' instead of `add-hook', you would, for example, change
  539. this:
  540.      (add-hook 'mail-citation-hook 'sc-cite-original)
  541.    to:
  542.      (setq mail-citation-hook 'sc-cite-original)
  543.    Note the lack of of a single quote on the first argument to `setq'.
  544. File: sc,  Node: MH-E with any Emacsen,  Next: VM with any Emacsen,  Prev: Emacs 18 MUAs,  Up: Getting Connected
  545. MH-E with any Emacsen
  546. =====================
  547.    MH-E 4.x conforms to the `mail-citation-hook' interface supported by
  548. other MUAs.  At the time of this writing, MH-E 4.0 has not been
  549. released, but if you have it, put this in your `.emacs' file to connect
  550. Supercite and MH-E 4.x:
  551.      (add-hook 'mail-citation-hook 'sc-cite-original)
  552.    Note that if you are using Emacs 18 or Epoch 4, you will not have the
  553. `add-hook' function.  *Note Emacs 18 MUAs:: for details on how to
  554. proceed without `add-hook'.
  555.    MH-E version 3.x uses a slightly different interface than other MUAs.
  556. MH-E provides a hook variable `mh-yank-hooks', but it doesn't act like
  557. a hook, and doing an `add-hook' will not work.
  558.    To connect Supercite to MH-E 3.x, you should instead add the
  559. following to your `.emacs' file:
  560.      (add-hook 'mh-yank-hooks 'sc-cite-original)
  561.    You also need to make sure that MH-E includes all the original mail
  562. headers in the yanked message.  The variable that controls this is
  563. `mh-yank-from-start-of-msg'.  By default, this variable has the value
  564. `t', which tells MH-E to include all the mail headers when yanking the
  565. original message.  Before you switched to using Supercite, you may have
  566. set this variable to other values so as not to include the mail headers
  567. in the yanked message.  Since Supercite requires these headers (and
  568. cleans them out for you), you need to make sure the value is `t'.  This
  569. lisp, in your `.emacs' file will do the trick:
  570.      (setq mh-yank-from-start-of-msg t)
  571.    Note that versions of MH-E before 3.7 did not provide the
  572. `mh-yank-hooks' variable.  Your only option is to upgrade to MH-E
  573. version 3.7 or later.
  574. File: sc,  Node: VM with any Emacsen,  Next: GNEWS with any Emacsen,  Prev: MH-E with any Emacsen,  Up: Getting Connected
  575. VM with any Emacsen
  576. ===================
  577.    Since release 4.40, VM has supported the citation interface required
  578. by Supercite.  But since the interface has changed recently the details
  579. of getting connected differ with the version of VM you are using.
  580.    If you are running any release of VM after 4.40, you can add the
  581. following to your `.emacs' to connect Supercite with VM:
  582.      (add-hook 'mail-yank-hooks 'sc-cite-original)
  583.    Note that if you are using Emacs 18 or Epoch 4, you will not have the
  584. `add-hook' function.  *Note Emacs 18 MUAs:: for details on how to
  585. proceed without `add-hook'.
  586.    Since version 5.34, VM has supported the newer `mail-citation-hook'
  587. interface, but `mail-yank-hooks' is still being supported for backward
  588. compatibility.  If you are running a newer version of VM and you want
  589. to maintain consistency with other MUAs, use this bit of code instead:
  590.      (add-hook 'mail-citation-hook 'sc-cite-original)
  591. File: sc,  Node: GNEWS with any Emacsen,  Next: Overloading for Non-conforming MUAs,  Prev: VM with any Emacsen,  Up: Getting Connected
  592. GNEWS with any Emacsen
  593. ======================
  594.    As far as I know, no version of GNEWS supports the citation interface
  595. required by Supercite.  To connect Supercite with GNEWS, please first
  596. *note Overloading for Non-conforming MUAs::..
  597.    After you have followed the directions in that section.  You should
  598. add the following lisp code to your `.emacs' file:
  599.      (add-hook 'mail-citation-hook 'sc-cite-original)
  600.    Note that if you are using Emacs 18 or Epoch 4, you will not have the
  601. `add-hook' function.  *Note Emacs 18 MUAs:: for details on how to
  602. proceed without `add-hook'.
  603. File: sc,  Node: Overloading for Non-conforming MUAs,  Next: Replying and Yanking,  Prev: GNEWS with any Emacsen,  Up: Getting Connected
  604. Overloading for Non-conforming MUAs
  605. ===================================
  606.    As mentioned elsewhere, some MUAs do not provide the necessary hooks
  607. to connect with Supercite.  Supercite version 3.1 provides an
  608. unsupported mechanism, called "overloading" which redefines certain key
  609. functions in the MUA, so that it will call the `mail-citation-hook'
  610. variable instead of the MUA's default hard-coded citing routines.  Since
  611. most newer versions of the known MUAs support the `mail-citation-hook'
  612. variable, it is recommended that you upgrade if at all possible.  But
  613. if you can't upgrade, at least you're not out of luck!  Once you set up
  614. overloading properly, you should follow the directions for connecting
  615. Supercite to the Emacs 19 MUAs.  *Note Emacs 19 MUAs::.
  616.    Users of Bob Weiner's Hyperbole package take note.  Hyperbole
  617. provides the necessary overloads (and a whole lot more!) and you can
  618. potentially clobber it if you were to load Supercite's overloading after
  619. Hyperbole's.  For this reason, Supercite will *not* perform any
  620. overloading if it finds the variable `hyperb:version' is `boundp' (i.e.
  621. it exists because Hyperbole has been loaded into your Emacs session).
  622. If this is the case, Supercite will display a warning message in the
  623. minibuffer.  You should consult the Hyperbole manual for further
  624. details.
  625.    Overloading involves the re-definition of the citing function with
  626. the new, `mail-citation-hook' savvy version.  The function in
  627. `sc-oloads.el' that does this is `sc-perform-overloads'.  This function
  628. is smart enough to only overload the MUA functions when it is
  629. absolutely necessary, based on the version numbers it can figure out.
  630. Also, `sc-perform-overloads' will only install the new functions once.
  631. It is also smart enough to do nothing if the MUA is not yet loaded.
  632.    The tricky part is finding the right time and place to perform the
  633. overloading.  It must be done after the MUA has been loaded into your
  634. Emacs session, but before the first time you try to yank in a message.
  635. Fortunately, this has been figured out for you.
  636.    If you must overload, you should put the following lisp code in your
  637. `.emacs' file, to make sure the `sc-oloads.el' file gets loaded at the
  638. right time:
  639.      (autoload 'sc-perform-overloads "sc-oloads" "Supercite 3.1" t)
  640.    Then you must make sure that the function `sc-perform-overloads'
  641. gets run at the right time.  For GNUS, put this in your `.emacs' file:
  642.      (setq news-reply-mode-hook 'sc-perform-overloads)
  643.      (setq mail-setup-hook 'sc-perform-overloads)
  644.    If you are using RNEWS, put this in your `.emacs' file:
  645.      (setq news-reply-mode-hook 'sc-perform-overloads)
  646.    If you are using RMAIL or PCMAIL, put this in your `.emacs' file:
  647.      (setq mail-setup-hook 'sc-perform-overloads)
  648.    If you are using GNEWS, put this in your `.emacs' file:
  649.      (setq news-reply-mode-hook 'sc-perform-overloads)
  650.      (setq gnews-ready-hook 'sc-perform-overloads)
  651.    Now go back and follow the directions for getting the Emacs 19 MUAs
  652. connected to Supercite.  Be sure to *note Emacs 18 MUAs::. on
  653. substitutes for Emacs 19's `add-hook' function.
  654. File: sc,  Node: Replying and Yanking,  Next: Reply Buffer Initialization,  Prev: Overloading for Non-conforming MUAs,  Up: Top
  655. Replying and Yanking
  656. ********************
  657.    This chapter explains what happens when you reply and yank an
  658. original message from an MUA.
  659. * Menu:
  660. * Reply Buffer Initialization::
  661. * Filling Cited Text::
  662. File: sc,  Node: Reply Buffer Initialization,  Next: Filling Cited Text,  Prev: Replying and Yanking,  Up: Replying and Yanking
  663. Reply Buffer Initialization
  664. ===========================
  665.    Executing `sc-cite-original' performs the following steps as it
  666. initializes the reply buffer:
  667.   1. *Runs `sc-pre-hook'.* This hook variable is run before
  668.      `sc-cite-original' does any other work.  You could conceivably use
  669.      this hook to set certain Supercite variables based on the reply
  670.      buffer's mode or name (i.e., to do something different based on
  671.      whether you are replying or following up to an article).
  672.   2. *Inserts Supercite's keymap.* Supercite provides a number of
  673.      commands for performing post-yank modifications to the reply
  674.      buffer.  These commands are installed on Supercite's top-level
  675.      keymap.  Since Supercite has to interface with a wide variety of
  676.      MUAs, it does not install all of its commands directly into the
  677.      reply buffer's keymap.  Instead, it puts its commands on a keymap
  678.      prefix, then installs this prefix onto the buffer's keymap.  What
  679.      this means is that you typically have to type more characters to
  680.      invoke a Supercite command, but Supercite's keybindings can be
  681.      made much more consistent across MUAs.
  682.      You can control what key Supercite uses as its keymap prefix by
  683.      changing the variable `sc-mode-map-prefix'.  By default, this
  684.      variable is set to `C-c C-p'; a finger twister perhaps, but
  685.      unfortunately the best default due to the scarcity of available
  686.      keybindings in many MUAs.
  687.   3. *Turns on Supercite minor mode.* The modeline of the reply buffer
  688.      should indicate that Supercite is active in that buffer by
  689.      displaying the string `SC'.
  690.   4. *Sets the "Undo Boundary".* Supercite sets an undo boundary before
  691.      it begins to modify the original yanked text.  This allows you to
  692.      easily undo Supercite's changes to affect alternative citing
  693.      styles.
  694.   5. *Processes the the mail headers.* All previously retrieved info
  695.      key-value pairs are deleted from the info alist, then the mail
  696.      headers in the body of the yanked message are scanned. Info
  697.      key-value pairs are created for each header found. Also, such
  698.      useful information as the author's name and email address are
  699.      extracted.  If the variable `sc-mail-warn-if-non-rfc822-p' is
  700.      non-`nil', then Supercite will warn you if it finds a mail header
  701.      that does not conform to RFC822.  This is rare and indicates a
  702.      problem either with your MUA or the original author's MUA, or some
  703.      MTA (mail transport agent) along the way.
  704.      Once the info keys have been extracted from the mail headers, the
  705.      headers are nuked from the reply buffer.  You can control exactly
  706.      which headers are removed or kept, but by default, all headers are
  707.      removed.
  708.      There are two variables which control mail header nuking.  The
  709.      variable `sc-nuke-mail-headers' controls the overall behavior of
  710.      the header nuking routines.  By setting this variable to `'all',
  711.      you automatically nuke all mail headers.  Likewise, setting this
  712.      variable to `'none' inhibits nuking of any mail headers.  In
  713.      between these extremes, you can tell Supercite to nuke only a
  714.      specified list of mail headers by setting this variable to
  715.      `'specified', or to keep only a specified list of headers by
  716.      setting it to `'keep'.
  717.      If `sc-nuke-mail-headers' is set to `'specified' or `'keep', then
  718.      the variable `sc-nuke-mail-header-list' is consulted for the list
  719.      of headers to nuke or keep.  This variable contains a list of
  720.      regular expressions.  If the mail header line matches a regular
  721.      expression in this list, the header will be nuked or kept.  The
  722.      line is matched against the regexp using `looking-at' rooted at
  723.      the beginning of the line.
  724.      If the variable `sc-blank-lines-after-headers' is non-`nil', it
  725.      contains the number of blank lines remaining in the buffer after
  726.      mail headers are nuked.  By default, only one blank line is left
  727.      in the buffer.
  728.   6. *Selects the attribution and citation strings.* Once the mail
  729.      headers have been processed, Supercite selects a attribution
  730.      string and a citation string which it will use to cite the
  731.      original message.  *Note Selecting an Attribution:: for details.
  732.   7. *Cites the message body.* After the selection of the attribution
  733.      and citation strings, Supercite cites the original message by
  734.      inserting the citation string prefix in front of every uncited
  735.      line.  You may not want Supercite to automatically cite very long
  736.      messages however.  For example, some email could contain a smaller
  737.      header section followed by a huge uuencoded message.  It wouldn't
  738.      make sense to cite the uuencoded message part when responding to
  739.      the original author's short preface.  For this reason, Supercite
  740.      provides a variable which limits the automatic citation of long
  741.      messages to a certain maximum number of lines.  The variable is
  742.      called `sc-cite-region-limit'.  If this variable contains an
  743.      integer, messages with more lines that this will not be cited at
  744.      all, and a warning message will be displayed.  Supercite has
  745.      performed everything necessary, though, for you to manually cite
  746.      only the small portion of the original message that you want to
  747.      use.
  748.      If `sc-cite-region-limit' contains a non-`nil' value, the original
  749.      message will always be cited, regardless of its size.  If the
  750.      variable contains the value `nil', the region will never be cited
  751.      automatically.  Use this if you always want to be able to edit and
  752.      cite the message manually.
  753.      The variable `sc-cite-blank-lines-p' controls whether blank lines
  754.      in the original message should be cited or not.  If this variable
  755.      is non-`nil', blank lines will be cited just like non-blank lines.
  756.      Otherwise, blank lines will be treated as paragraph separators.
  757.      Citing of the original message is highly configurable. Supercite's
  758.      default setup does a pretty good job of citing many common forms of
  759.      previously cited messages.  But there are as many citation styles
  760.      out there as people on the net, or just about!  It would be
  761.      impossible for Supercite to anticipate every style in existence,
  762.      and you probably wouldn't encounter them all anyway.  But you can
  763.      configure Supercite to recognize those styles you see often.
  764.      *Note Configuring the Citation Engine:: for details.
  765.   8. *Runs `sc-post-hook'.* This variable is very similar to
  766.      `sc-pre-hook', except that it runs after `sc-cite-original' is
  767.      finished. This hook is provided mostly for completeness and
  768.      backward compatibility. Perhaps it could be used to reset certain
  769.      variables set in `sc-pre-hook'.
  770. File: sc,  Node: Filling Cited Text,  Next: Selecting an Attribution,  Prev: Reply Buffer Initialization,  Up: Replying and Yanking
  771. Filling Cited Text
  772. ==================
  773.    Supercite will automatically fill newly cited text from the original
  774. message unless the variable `sc-auto-fill-region-p' has a `nil' value.
  775. Supercite will also re-fill paragraphs when you manually cite or
  776. re-cite text.
  777.    However, during normal editing, Supercite itself cannot be used to
  778. fill paragraphs.  This is a change from version 2.  There are other
  779. add-on lisp packages which do filling much better than Supercite ever
  780. did.  The two best known are "filladapt" and "gin-mode".  Both work well
  781. with Supercite and both are available at the normal Emacs Lisp archive
  782. sites.  "gin-mode" works pretty well out of the box, but if you use
  783. "filladapt", you may want to run the function `sc-setup-filladapt' from
  784. your `sc-load-hook'.  This simply makes "filladapt" a little more
  785. Supercite savvy than its default setup.
  786.    Also, Supercite will collapse leading whitespace between the citation
  787. string and the text on a line when the variable `sc-fixup-whitespace-p'
  788. is non-`nil'.  The default value for this variable is `nil'.
  789.    Its important to understand that Supercite's automatic filling
  790. (during the initial citation of the reply) is very fragile.  That is
  791. because figuring out the `fill-prefix' for a particular paragraph is a
  792. really hard thing to do automatically.  This is especially the case when
  793. the original message contains code or some other text where leading
  794. whitespace is important to preserve.  For this reason, many Supercite
  795. users typically run with `sc-auto-fill-region-p' (and possibly also
  796. `sc-fixup-whitespace-p') set to `nil'.  They then manually fill each
  797. cited paragraph in the reply buffer.
  798.    I usually run with both these variables containing their default
  799. values.  When Supercite's automatic filling breaks on a particular
  800. message, I will use Emacs' undo feature to undo back before the
  801. citation was applied to the original message.  Then I'll toggle the
  802. variables and manually cite those paragraphs that I don't want to fill
  803. or collapse whitespace on.  *Note Variable Toggling Shortcuts::.
  804.    If you find that Supercite's automatic filling is just too fragile
  805. for your tastes, you might consider one of these alternate approaches.
  806. Also, to make life easier, a shortcut function to toggle the state of
  807. both of these variables is provided on the key binding `C-c C-p C-p'
  808. (with the default value of `sc-mode-map-prefix'; *note Post-yank
  809. Formatting Commands::.).
  810.    You will noticed that the minor mode string will show the state of
  811. these variables as qualifier characters. When both variables are `nil',
  812. the Supercite minor mode string will display `SC'.  When just
  813. `sc-auto-fill-region-p' is non-`nil', the string will display `SC:f',
  814. and when just `sc-fixup-whitespace-p' is non-`nil', the string will
  815. display `SC:w'.  When both variables are non-`nil', the string will
  816. display `SC:fw'.  Note that the qualifiers chosen are mnemonics for the
  817. default bindings of the toggling function for each respective variable.
  818. *Note Variable Toggling Shortcuts::.
  819.    Why are these variables not set to `nil' by default?  It is because
  820. many users won't manually fill paragraphs that are Supercited, and there
  821. have been widespread complaints on the net about mail and news messages
  822. containing lines greater than about 72 characters.  So the default is to
  823. fill cited text.
  824. File: sc,  Node: Selecting an Attribution,  Next: Attribution Preferences,  Prev: Filling Cited Text,  Up: Top
  825. Selecting an Attribution
  826. ************************
  827.    As you know, the attribution string is the part of the author's name
  828. that will be used to composed a non-nested citation string. Supercite
  829. scans the various mail headers present in the original article and uses
  830. a number of heuristics to extract strings which it puts into the
  831. "attribution association list" or "attribution alist". This is
  832. analogous, but different than, the info alist previously mentioned. Each
  833. element in the attribution alist is a key-value pair containing such
  834. information as the author's first name, middle names, and last name, the
  835. author's initials, and the author's email terminus.
  836. * Menu:
  837. * Attribution Preferences::
  838. * Anonymous Attributions::
  839. * Author Names::
  840.